import {
    NavigationGuardNext,
    RouteLocationNormalized,
    RouteRecordRaw,
    createRouter,
    createWebHistory,
  } from "vue-router";
  
  // 配置页面路由
  const routes: Array<RouteRecordRaw> = [
    {
      
        path:"/",
        name:"index",
        // 默认定向到 /newpage
        
        children:[
          {
            path: "/login", // 登录页面
            name: "login",
            component: () => import("@/views/login/index.vue"),
            children: [
              {
                path: "/login",
                name: "loginIndex",
                component: () => import("@/views/login/account-panel.vue"),
              }
            ],
          },
          {
            path:"/new-page", // 主页面
            name:"new-page",
            
            component: () => import("@/views/new-page.vue"),
            children:[{
              path:"/quotes", // 主页面
              name:"quotes",
              component: () => import("@/views/login/index.vue"),
            }]
          },
          
          {
          // 增加一个路由
          path:"/newpage",
          name:"newpage",
          // 指向页面
          component: () => import("@/views/new-page.vue"),
        }]
    }
  ];
  const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes,
  });
  router.beforeEach(
    (
      to: RouteLocationNormalized,
      from: RouteLocationNormalized,
      next: NavigationGuardNext
    ) => {
      next();
    }
  );
  export default router;
  